finp$="picture.gif"

fout$=finp$+".bin"
' converts a 256x192 2c picture into a 'pmode4:screen1,1' binary file
setdisplay(256,192,32,1):paper(8^8-1):ink(0):pen(0):cls
loadimage(finp$,1):pasteicon(0,0,1)
open fout$ for output as #1
for y=0 to 191
  for x1=0 to 31
    btv=0:btt=0
    for x2=7 to 0 step -1
      btv=btv*2
      u=point(x1*8+(7-x2),y)
      b=u mod 256: u=int(u/256)
      g=u mod 256: u=int(u/256)
      r=u mod 256: u=int(u/256)
      btt=1
      if g<128 then:btt=0:end if
      btv=btv+btt
      next
    writebyte(1,btv)
    next:next
close #1
'waitkey

